﻿<UserControl x:Class="Insteon.Mayhem.Widgets.SwitchLincAnimation"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             >

    <UserControl.Resources>
        <Storyboard x:Key="SetButtonPressStoryboard" RepeatBehavior="Forever">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="Finger">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="-162.667"/>
                <EasingDoubleKeyFrame KeyTime="0:0:4" Value="-162.667"/>
                <EasingDoubleKeyFrame KeyTime="0:0:6" Value="0.333"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="Finger">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="6.667"/>
                <EasingDoubleKeyFrame KeyTime="0:0:4" Value="6.667"/>
                <EasingDoubleKeyFrame KeyTime="0:0:6" Value="108.167"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Light8">
                <DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:4" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:4.5" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:5" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:5.5" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:6" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:6.5" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:7" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:7.5" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:8" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:8.5" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:9" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:9.5" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:10" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:10.5" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:11" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:11.5" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:12" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:15" Value="{x:Static Visibility.Visible}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Light0">
                <DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:4" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="step1TextBlock">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:1.5" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:3.5" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:4" Value="{x:Static Visibility.Visible}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="step2TextBlock">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:3.5" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:4" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:14.6" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:15" Value="{x:Static Visibility.Visible}"/>
            </ObjectAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="step1TextBlock">
            	<EasingDoubleKeyFrame KeyTime="0" Value="0.75"/>
            	<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.495"/>
            	<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="1"/>
            	<EasingDoubleKeyFrame KeyTime="0:0:3.5" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:4" Value="0.75"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="step2TextBlock">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.75"/>
                <EasingDoubleKeyFrame KeyTime="0:0:3.5" Value="0.75"/>
            	<EasingDoubleKeyFrame KeyTime="0:0:4" Value="1"/>
            	<EasingDoubleKeyFrame KeyTime="0:0:14.6" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:15" Value="0.75"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard x:Name="SetButtonPressStoryboard_BeginStoryboard" Storyboard="{StaticResource SetButtonPressStoryboard}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource SetButtonPressStoryboard}"/>
        </EventTrigger>
    </UserControl.Triggers>

    <Viewbox>
        <Grid x:Name="LayoutRoot" HorizontalAlignment="Left" Height="375" VerticalAlignment="Top" Width="400">
            <Image x:Name="SwitchLinc" Source="/Insteon.Mayhem;component/Widgets/Images/SwitchLinc.png" Stretch="Fill" Margin="53,0,47,75"/>
            <Image x:Name="Finger" Height="185" Source="/Insteon.Mayhem;component/Widgets/Images/Finger.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" Margin="79.333,0,35.667,-185.667" VerticalAlignment="Bottom">
                <Image.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Image.RenderTransform>
            </Image>
            <Ellipse x:Name="Light8" Height="4.333" Width="4.333" HorizontalAlignment="Left" Margin="166.833,79.834,0,0" VerticalAlignment="Top">
                <Ellipse.Fill>
                    <RadialGradientBrush>
                        <GradientStop Color="White" Offset="0.43"/>
                        <GradientStop Color="#FF1EDAC4" Offset="0.692"/>
                        <GradientStop Color="White" Offset="0.865"/>
                        <GradientStop Color="#CC000000" Offset="1"/>
                    </RadialGradientBrush>
                </Ellipse.Fill>
            </Ellipse>
            <Ellipse x:Name="Light0" Height="4.333" Width="4.333" Visibility="Hidden" HorizontalAlignment="Left" Margin="166.833,145.834,0,0" VerticalAlignment="Top">
                <Ellipse.Fill>
                    <RadialGradientBrush>
                        <GradientStop Color="White" Offset="0.43"/>
                        <GradientStop Color="#FF1EDAC4" Offset="0.692"/>
                        <GradientStop Color="White" Offset="0.865"/>
                        <GradientStop Color="#CC000000" Offset="1"/>
                    </RadialGradientBrush>
                </Ellipse.Fill>
            </Ellipse>
            <TextBlock x:Name="step1TextBlock" Text="Hold the SET button down for 3 seconds to put an INSTEON device into linking mode." Width="110" Height="265" Visibility="Visible" TextWrapping="Wrap" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Left" Margin="8,0,0,93" VerticalAlignment="Bottom" />
            <TextBlock x:Name="step2TextBlock" Text="A blinking light indicates the device is in linking mode." Width="102" Visibility="Visible" TextWrapping="Wrap" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Right" Margin="0,17,8,93" />
        </Grid>
    </Viewbox>


</UserControl>
